package com.corpgovernment.costcenter.mapper;

import com.corpgovernment.costcenter.entity.db.MbOrgCostInfo;
import com.corpgovernment.organization.common.mybatis.TkMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: jt.qin
 * @DateTime: 2019/12/20 13:09
 * @Description
 */
@Repository
public interface MbOrgCostInfoMapper extends TkMapper<MbOrgCostInfo> {
    /**
     *
     * @param num 限制返回数量 -1为不限
     * @param orgIds 可变参数，可以穿单值，list
     * @return
     */
    List<MbOrgCostInfo> selectCostInfosByOrgId(@Param("num") Integer num, @Param("orgIds") List<String> orgIds);

    List<String> selectDepartmentByCompanyId(String departmentId);

	List<MbOrgCostInfo> listAll();

	List<MbOrgCostInfo> selectByCompanyId(@Param("companyId") String companyId);

    List<MbOrgCostInfo> selectByOrgId(@Param("orgId") String orgId);

    List<MbOrgCostInfo> selectByOrgIdList(@Param("orgIdList") List<String> orgIdList);
    /**
     * 模糊查询
     *
     * @param mbOrgCostInfo
     * @return
     */
    List<MbOrgCostInfo> selectMbOrgCostInfo(MbOrgCostInfo mbOrgCostInfo);

    List<MbOrgCostInfo> selectCostCenterByOrgScope(@Param("orgIds") List<String> orgIds,@Param("query") String query);

    /**
     * 增加成本中心有效时间段更新
     */
    int updateCostValidDate(MbOrgCostInfo mbOrgCostInfo);
}
